package hczc.longcai.com.hccrowdfunding.home.third_rankinglist.fragments;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

import hczc.longcai.com.hccrowdfunding.R;
import hczc.longcai.com.hccrowdfunding.application.BaseApplication;
import hczc.longcai.com.hccrowdfunding.home.third_rankinglist.adapters.RankingListAdapter;
import hczc.longcai.com.hccrowdfunding.home.third_rankinglist.beans.RankingListPopularity;

/**
 * 项目人气榜
 * A simple {@link Fragment} subclass.
 */
public class RankingListPopularityFragment extends Fragment {


    private static final String TAG = "RangkingListPopularityFragment";
    private ListView listView;
    private List<RankingListPopularity> list;
    private RankingListAdapter adapter;

    public RankingListPopularityFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_ranking_list_popularity, container, false);
        BaseApplication.scaleScreenHelper.loadView(((ViewGroup) view));
        initDatas();
        listView = ((ListView) view.findViewById(R.id.rankinglist_listview_popularity));
        adapter = new RankingListAdapter(getActivity(),list);
        listView.setAdapter(adapter);
        return view;
    }

    @Override
    public void onResume() {
        super.onResume();
//        Log.d(TAG,"项目人气榜");
    }

    private void initDatas() {
        list = new ArrayList<>();
        RankingListPopularity popularity = new RankingListPopularity();
        popularity.setType(1);
        list.add(popularity);
        list.add(popularity);
        list.add(popularity);
        list.add(popularity);

    }


}
